\documentclass[border=0.2cm]{standalone}
% Required package
\usepackage{tikz}
\usepackage{zenburn}
\usetikzlibrary{scopes,matrix,positioning}
\tikzset{
  mymx/.style={matrix of nodes,nodes=myball,column sep=4em,row sep=2ex},
  myball/.style={draw=zenfg,circle,inner sep=0pt},
  mylabel/.style={midway,sloped,fill=none,inner sep=1pt,outer sep=1pt,below,
    execute at begin node={$\scriptstyle},execute at end node={$}},
  plain/.style={draw=zenfg,fill=none},
  sel/.append style={fill=zengreen},
  prevsel/.append style={fill=zenred},
  route/.style={-latex,thick,draw=zenfg},
  selroute/.style={route,zencyan}
}
\begin{document}
\begin{tikzpicture}
  \matrix[mymx] (mx) {
    &|[prevsel]| $h_1(e)$ \\
    |[plain]| $x_1$ && 猫 \\
    &|[sel]| $h_2(e)$\\
    |[plain]| $x_2$ && 狗 \\
    & |[sel]| $h_3(e)$ \\
    |[plain]| $x_1$ &|[sel,yshift=4ex]| $h_1(e)$ & 猫 \\
    &|[prevsel]| $h_2$(e)\\
    |[plain]| $x_2$ &|[prevsel,yshift=-4ex]| $h_3(e)$ & 狗 \\
  };
  {[route]
    \foreach \y in {2,4} {
      \draw (mx-\y-1) -- (mx-1-2);}
    \foreach \y in {1,3,5} {
      \draw (mx-\y-2) -- (mx-2-3);
      \draw (mx-\y-2) -- (mx-4-3); }

    \foreach \y in {6,8} {
      \draw (mx-\y-1) -- (mx-6-2);
      \draw (mx-\y-1) -- (mx-7-2); }
    \foreach \y in {6,7,8} {
      \draw (mx-\y-2) -- (mx-6-3);
      \draw (mx-\y-2) -- (mx-8-3);}
    \draw (mx-8-1) -- (mx-8-2);
  }
  {[selroute]
    \draw (mx-2-1) -- (mx-3-2);
    \draw (mx-4-1) -- (mx-3-2);
    \draw (mx-2-1) -- (mx-5-2);
    \draw (mx-4-1) -- (mx-5-2);
    
    \draw (mx-6-1) -- (mx-6-2);
    \draw (mx-8-1) -- (mx-6-2);
  }
\end{tikzpicture}
\end{document}